<?php
//save employee modifications
if (isset($_POST['action'])) {
    switch ($_POST['action']) {
        case "Save Changes":
            $modifyEmployeeResult = modifyEmployee(
                    $_SESSION['userName'], $_SESSION['userPassHash'], $_POST['accName'], $_POST['dataHash'], $_POST['empFname'], $_POST['empLname'], $_POST['startDate'], $_POST['endDate'], $_POST['empStatus'], $_POST['address'], $_POST['email'], $_POST['phoneNum'], $_POST['wage']
            );
            break;
    }
}

$account = showEmployeeInfo(
        $_SESSION['userName'], $_SESSION['userPassHash'], $_SESSION['userName']
);
$_SESSION[$_SESSION['userName'] . 'employee'] = $account['hash'];
?>
<h3>My Profile</h3>

<form action="" method="post">
    <input type="hidden" name="dataHash" value="<?php echo($account['hash']); ?>" />
    <div class="controls-row">
        <div class="control-group span3">
            <label class="control-label" for="accountName">Account</label>
            <div class="controls">
                <input type="text" name="accountName" id="accountName" value="<?php echo($_SESSION['userName']); ?>" disabled />
            </div>
        </div>
        <div class="control-group span3">
            <label class="control-label" for="accountName">Status</label>
            <div class="controls">
                <input type="text" name="empStatus" id="empStatus" value="<?php echo($account[1]['empStatus']); ?>" disabled />
            </div>
        </div>
        <div class="control-group span3">
            <label class="control-label" for="wage">Wage</label>
            <div class="controls" id="wage">
                <input type="text" name="wage" id="wage" value="<?php echo($account[1]['wage']); ?>" disabled />
            </div>
        </div>
    </div>
    <div class="controls-row">
        <div class="control-group span3">
            <label class="control-label" for="empFname">First Name</label>
            <div class="controls">
                <input type="text" name="empFname" id="empFname" value="<?php echo($account[1]['empFname']); ?>" required />
            </div>
        </div>
        <div class="control-group span3">
            <label class="control-label" for="empLname">Last Name</label>
            <div class="controls">
                <input type="text" name="empLname" id="empLname" value="<?php echo($account[1]['empLname']); ?>" required />
            </div>
        </div>
        <div class="control-group span3">
            <label class="control-label" for="startDate">Start Date</label>
            <div class="controls">
                <input type="text" name="startDate" id="startDate" class="datepicker" value="<?php echo($account[1]['startDate']); ?>" />
            </div>
        </div>
    </div>
    <div class="controls-row">
        <div class="control-group span3">
            <label class="control-label" for="address">Address</label>
            <div class="controls">
                <input type="text" name=""
        </div>
    </div>
</form>


<form action="" method="post">
    <table>
        <tr>
            <td colspan="2"><input type="hidden" name="dataHash" value="<?php echo($account['hash']); ?>" /></td>
        </tr>
        <tr>
            <td>Account Name</td>
            <td><input type="text" readonly name="accName" value="<?php echo($_SESSION['userName']); ?>" /></td>
        </tr>
        <tr>
            <td>First Name</td>
            <td><input type="text" name="empFname" value="<?php echo($account[1]['empFname']); ?>" /></td>
        </tr>
        <tr>
            <td>Last Name</td>
            <td><input type="text" name="empLname" value="<?php echo($account[1]['empLname']); ?>" /></td>
        </tr>
        <tr>
            <td>Start Date</td>
            <td><input type="text" name="startDate" value="<?php echo($account[1]['startDate']); ?>" />
                <input type="hidden" name="endDate" value="<?php echo($account[1]['endDate']); ?>" /></td>
        </tr>
        <tr>
            <td>Status</td>
            <td>
                <input type="text" name="empStatus" readonly value="<?php echo($account[1]['empStatus']); ?>" />
            </td>
        </tr>
        <tr>
            <td>Address</td>
            <td><input type="text" name="address" value="<?php echo($account[1]['address']); ?>" /></td>
        </tr>
        <tr>
            <td>Email</td>
            <td><input type="text" name="email" value="<?php echo($account[1]['email']); ?>" /></td>
        </tr>
        <tr>
            <td>Phone Number</td>
            <td><input type="text" name="phoneNum" value="<?php echo($account[1]['phoneNum']); ?>" /></td>
        </tr>
        <tr>
            <td>Wage</td>
            <td><input type="text" readonly name="wage" value="<?php echo($account[1]['wage']); ?>" /></td>
        </tr>
        <tr>
            <td colspan="2"><input class="btn" type="submit" name="action" value="Save Changes" /></td>
        </tr>
    </table>
</form>
